#ifndef __MAINGAME_SCENE_H__
#define __MAINGAME_SCENE_H__

#include "cocos2d.h"
#include "CZWMainGameMrg.h"
#include "CZWHero.h"


class MainGameScene: public cocos2d::CCLayer
{
public:
	~MainGameScene(){m_pSelf = NULL;};

	static MainGameScene* m_pSelf;
	static MainGameScene* getSelf(){return m_pSelf;};
    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
    virtual bool init();

    // there's no 'id' in cpp, so we recommend returning the class instance pointer
    static cocos2d::CCScene* scene();
	
	virtual void registerWithTouchDispatcher(void);

	virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
	virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent);
	virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent);
	virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent);
    
	void initHeroUI(CZWHero* pHero);
	//
	void onGameStart();
	void onGameEnd();
    // a selector callback
    void menuCloseCallback(CCObject* pSender);
    
    // implement the "static node()" method manually
    CREATE_FUNC(MainGameScene);

	static CCSize visibleSize;
	static CCPoint origin;

	CZWITEMDATA* m_pSelectedItem;

	CCNode* my_GameNode;

	CZWMainGameMrg MyGame;

	void updata(float dt);
};

#endif // __HELLOWORLD_SCENE_H__
